# -*- coding:utf-8 -*-
__author__ = 'shuxin'
__date__ = '2020/6/13  15:45'

import json

from django.http import HttpResponse
from django.views import View


class OrderExportView(View):
    def get(self, request):
        info = {
            "alitrip_ie_agent_order_search_response": {
                "base_order_vos": {
                    "ie_base_order_vo": [
                        {
                            "arr_airport": "demo",  # 达到机场
                            "flight_nos": "demo",  # 全部航班号
                            "trade_order_id": "5ef80f1f08be1590e1e491ee",  # 交易订单id
                            "gmt_create_time": "2015-01-13 21:15:59",  # 订单创建时间
                            "success_time": "2015-01-13 21:15:59",  # 订单成功时间
                            "total_service_price": 123,  # 总价
                            "inbound_dep_time": "2015-01-13 21:15:59",  # 回程出发日期
                            "credit_status": "demo",  # 信用状态
                            "pay_time": "2015-01-13 21:15:59",  # 支付时间
                            "inbound_arr_time": "2015-01-13 21:15:59",  # 回程到达时间
                            "pay2_agent_time": "2015-01-13 21:15:59",  # 转交易时间
                            "book_time": "2015-01-13 21:15:59",  # 预定hk时间
                            "commission_status": "demo",  # 佣金状态
                            "total_ticket_price": 123,  # 总票价
                            "total_activity_remit_price": 123,  # 活动金额
                            "total_tax_price": 123,  # 总税费
                            "outbound_dep_time": "2015-01-13 21:15:59",  # 出发时间
                            "total_price": 123,  # 订单总价
                            "total_redpackage": 123,  # 红包价格
                            "dep_airport": "demo",  # 出发机场
                            "commission_price": 123,  # 佣金金额
                            "trip_type": "OneWay",  # 航程类型(OneWay:单程,RoundTrip:往返,MultiCity:多程)
                            "order_status": "demo",  # 订单状态
                            "close_time": "2015-01-13 21:15:59",  # 订单关闭时间
                            "pay_status": "demo",  # 支付状态
                            "close_type": "demo",  # 关闭类型
                            "passenger_count": 123,  # 乘机人数量
                            "est_commission_price": 123,  # 预计佣金金额
                            "close_reason": "demo",  # 关闭原因
                            "outbound_arr_time": "2015-01-13 21:15:59",  # 出发到达日期
                            "origin_total_price": 123,  # 订单初始总价
                            "gold_medal_order": True,  # 金牌订单
                            "speed_ticket_order": True,  # 极速出票订单：true:是, false:否
                            "product_tags": {
                                # 产品标签：student:学生票、nationality：国籍票、group：小团票、gold：金牌机票、card：宝贝机票、common：年龄票、speed：极速机票、age：限年龄票、delay：延时出票
                                "string": [
                                    "delay"
                                ]
                            }
                        }
                    ]
                },
                "query_success": True,
                "has_next": True
            }
        }
        error_info = {
            "status": "F103",
            "msg": "订单状态不正确",
            "orderLists": None
        }

        return HttpResponse(json.dumps(info, ensure_ascii=False), content_type="application/json")
